package com.mydemo.entity;

import com.mydemo.utils.dataUtils.entity;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.util.List;

@Data
@AllArgsConstructor
@NoArgsConstructor
public class Car extends entity {
    /**
     * 汽车类都应该有哪些内容？
     * Id
     * 是否被驾驶
     * 车型
     * 车辆品牌
     * 车辆具体型号
     * 车牌
     * 座位数量
     * 日-+租金
     * 租赁折扣
     * 票价
     * 每日往返次数
     * 谁在驾驶
     */
//    private int Id;
    private boolean isDrive = false;
    private String carModel;
    private String carBrand;
    private String carModelDetail;
    private String carId;
    private int seatNum;
    private int rentPrise;
    private int discount;
    private int price;
    private int dayRunTime;
    private List<CarState> states;
    private List<CarEntry> entries;
    private int days;
//    private int isDeleted;
//    ↑↑ 折扣在租车的时候根据车型提供，包括轿车，客车，无折扣等


    public Car(String carModel, String carBrand, String carModelDetail, int seatNum, String carId, int rentPrise, int price) {
        this.carModel = carModel;
        this.carBrand = carBrand;
        this.carModelDetail = carModelDetail;
        this.seatNum = seatNum;
        this.carId = carId;
        this.rentPrise = rentPrise;
        this.price = price;
        this.dayRunTime = 5;
    }


    // 重写 toString 方法，以更清晰的格式展示车辆信息
    @Override
    public String toString() {
        return "Car{" +
                "车型='" + carModel + '\'' +
                ", 品牌='" + carBrand + '\'' +
                ", 型号='" + carModelDetail + '\'' +
                ", 座位数=" + seatNum +
                ", 车牌='" + carId + '\'' +
                ", 日租金=" + rentPrise +
                ", 票价=" + price +
                ", 车次=" + dayRunTime +
                '}';
    }
}
